package com.dragon.repository.mapper;

import com.dragon.repository.entity.Mod;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 模块表 Mapper 接口
 * </p>
 *
 * @author sy
 * @since 2023-07-20
 */
@Mapper
public interface ModMapper extends BaseMapper<Mod> {

    @Select("SELECT a.* FROM `dragon_mod` a " +
            "INNER JOIN dragon_mod_role b on b.mod_id = a.id " +
            "INNER JOIN dragon_role c on b.role_id  = c.id where c.id = #{id}")
    List<Mod> selectListByRoleId(Integer id);
}
